import { createStore, createLogger } from 'vuex';
import state from './state';
import mutations from './mutations';
import * as actions from './actions';
import * as getters from './getters';

// 开发环境
const debug = process.env.NODE_ENV !== 'production';

export default createStore({
  state,
  mutations,
  actions,
  getters,
  strict: debug, // 严格模式
  plugins: debug ? [createLogger()] : [] // vuex插件
});
